<?php $this->renderPartial('_tabs'); ?>
<div>
	<div class="main-title no-border">
		<h1>Programs</h1>
	</div>
	<div class="grid_16">
		<div class="section">
			<div class="block">
				<h2>List of Pre-approved Programmes</h2>
				<?php
				$this->widget('PsGridView', array(
					'id' => 'approved-program-grid',
					'dataProvider' => $dataProvider,
					'template' => '{items}{pager}{pagesize}',
					'columns' => array(
						'id' => array(
							'class' => 'CCheckBoxColumn',
							'name' => 'id',
							'value' => '$data->id',
							'selectableRows' => 2,
							'checkBoxHtmlOptions' => array(
								'name' => 'approve_program_id[]'
							),
							'htmlOptions' => array(
								'width' => 16,
							),
						),
						'name',
						array(
							'header' => 'Course Provider',
							'type' => 'raw',
							'value' => '$data->getCourseProvider()'
						),
						array(
							'name' => 'course_type_id',
							'value' => 'GxHtml::valueEx($data->courseType)',
							'filter' => GxHtml::listDataEx(CourseType::model()->findAllAttributes(null, true)),
						),
//		'short_description',
//		'full_description',
//				'start_time',
//				'end_time',
//				'duration',
						'cpd_hours',
//					array(
//						'header' => 'Price',
//						'name' => 'price',
//						'type' => 'raw',
//						'value' => 'isset($data->price)?Yii::app()->numberFormatter->formatCurrency($data->price, "$"):"TBD"',
//						'htmlOptions' => array(
//							'class' => 'align-center',
//							'width' => 100
//						),
//						'headerHtmlOptions' => array('class' => 'align-center')
//					),
//					'location',
						array(
							'class' => 'CButtonColumn',
							'template' => '{view}'
						),
					),
				));
				?>
			</div>
		</div>
		<div class="section">
			<div class="block">
				<h2>Browse Programmes</h2>
			</div>
		</div>
		<?php
		$form = $this->beginWidget('GxActiveForm', array(
			'id' => 'bulk-approve-program',
			'action' => array('/cpd/program/bulkApprove'),
		));
		?>
		<div id="" class="box">
			<?php
			$this->widget('PsGridView', array(
				'id' => 'program-grid',
				'dataProvider' => $model->search(),
				'filter' => $model,
				'template' => '{items}{pager}{pagesize}',
				'columns' => array(
					'id' => array(
						'class' => 'CCheckBoxColumn',
						'name' => 'id',
						'value' => '$data->id',
						'selectableRows' => 2,
						'checkBoxHtmlOptions' => array(
							'name' => 'program_id[]'
						),
						'htmlOptions' => array(
							'width' => 16,
						),
					),
					'name',
					array(
						'header' => 'Course Provider',
						'type' => 'raw',
						'value' => '$data->getCourseProvider()'
					),
					array(
						'name' => 'course_type_id',
						'value' => 'GxHtml::valueEx($data->courseType)',
						'filter' => GxHtml::listDataEx(CourseType::model()->findAllAttributes(null, true)),
					),
//		'short_description',
//		'full_description',
//				'start_time',
//				'end_time',
//				'duration',
					'cpd_hours',
					array(
						'header' => 'Price',
						'name' => 'price',
						'type' => 'raw',
						'value' => 'isset($data->price)?Yii::app()->numberFormatter->formatCurrency($data->price, "$"):"TBD"',
						'htmlOptions' => array(
							'class' => 'align-center',
							'width' => 100
						),
						'headerHtmlOptions' => array('class' => 'align-center')
					),
					'location',
					array(
						'header' => 'Approval Status',
						'type' => 'raw',
						'value' => '$data->isApproved(Yii::app()->user->model->agency_id)?"Approved":"Not Approved"'
					),
					array(
						'class' => 'CButtonColumn',
						'template' => '{view}'
					),
				),
			));
			?>
		</div>
		<div id="">
			<label for="bulk_program_approve">Approve Selected Course</label>
			<?php echo GxHtml::submitButton(Yii::t('app', 'Approve'), array('class' => '', 'name' => 'bulk_action_confirm')); ?>
		</div>
		<?php $this->endWidget(); ?>
	</div>
</div>